﻿<Window x:Class="Help.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Help -> Numerical Methods" Height="600" Width="1000">
    <Grid>
        <Grid.Resources>

            <XmlDataProvider x:Key="SamplesList"  XPath="/Samples" Source="samples.xml" />


            <Style TargetType="{x:Type TextBlock}">
                <Setter Property="FontFamily" Value="Calibri" />
                <Setter Property="FontSize" Value="10pt" />
            </Style>
            <DataTemplate x:Key="SamplesListItemTemplate">
                <StackPanel>
                    <TextBlock Text="{Binding XPath=@Title}"></TextBlock>
                </StackPanel>
            </DataTemplate>
            <Style x:Key="SamplesListBox" TargetType="{x:Type ListBox}">
                <Setter Property="ItemTemplate" Value="{DynamicResource SamplesListItemTemplate}" />
                <Setter Property="ItemContainerStyle" Value="{DynamicResource SamplesListBoxItem}" />
                <Setter Property="BorderBrush" Value="Transparent" />
                <Setter Property="Width" Value="186" />
            </Style>
            <Style x:Key="SamplesListBoxItem" TargetType="{x:Type ListBoxItem}">
                <Setter Property="Background" Value="Transparent" />
                <Setter Property="Margin" Value="1" />
                <Setter Property="Cursor" Value="Hand" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ListBoxItem}">
                            <Grid>
                                <Rectangle x:Name="ListBG" Fill="{TemplateBinding Background}" RadiusX="5" RadiusY="5" Stroke="transparent"></Rectangle>
                                <Rectangle x:Name="GelShine" Margin="2,2,2,0" VerticalAlignment="top" RadiusX="3" RadiusY="3" Opacity="0" Fill="#ccffffff" Stroke="transparent" Height="15px"></Rectangle>
                                <ContentPresenter x:Name="ContentSite" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="15,5,5,5" />
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsSelected" Value="true">
                                </Trigger>
                                <Trigger Property="IsFocused" Value="true">
                                    <Setter Property="Background" Value="sc#1.000000, 0.769689, 0.831936, 1.000000" />
                                    <Setter Property="FontWeight" Value="bold" />
                                    <Setter Property="Foreground" Value="black" />
                                    <Setter TargetName="ListBG" Property="Rectangle.Stroke" Value="sc#1.000000, 0.250141, 0.333404, 0.884413" />
                                    <Setter TargetName="GelShine" Property="Rectangle.Opacity" Value="1" />
                                </Trigger>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter Property="Background" Value="sc#1.000000, 0.769689, 0.831936, 1.000000" />
                                    <Setter Property="Foreground" Value="black" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Grid.Resources>

        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid  Background="sc#1.000000, 0.769689, 0.831936, 1.000000" Name="DocumentRoot" >
            <Grid.RowDefinitions>
                <RowDefinition Height="50" />
                <RowDefinition Height="*" />
                <RowDefinition Height="20" />
            </Grid.RowDefinitions>
            <TextBlock  Grid.Row="0" Grid.RowSpan="2"  Margin="20,5,20,5" TextAlignment="Center"  Foreground="sc#1.000000, 0.250141, 0.333404, 0.884413" FontStyle="Italic" FontSize="30pt" FontFamily="Calibri" FontWeight="bold">Numerical Methods</TextBlock>
            <Grid Grid.Row="1">
                <Rectangle Fill="white" RadiusX="14" RadiusY="14" Margin="10" Stroke="sc#1.000000, 0.250141, 0.333404, 0.884413" StrokeDashArray="2"/>
                <DockPanel DockPanel.LastChildFill="True"   Margin="20">
                    <Grid  Width="220px">
                        <Rectangle Fill="sc#1.000000, 0.769689, 0.831936, 1.000000" RadiusX="10" RadiusY="10" Stroke="sc#1.000000, 0.250141, 0.333404, 0.884413" StrokeDashArray="2" />

                       
                            <DockPanel Margin="7" DockPanel.LastChildFill="False">
                         
            <TextBlock Margin="0,0,0,10"   Text="Help Library" Foreground="sc#1.000000, 0.250141, 0.333404, 0.884413" TextAlignment="center"   FontWeight="Bold" FontSize="14pt"   DockPanel.Dock="top"  />
             
                
<ScrollViewer  Name="scrollViewer1" DockPanel.Dock="Top" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" FlowDirection="LeftToRight" VerticalScrollBarVisibility="Auto">
    
    <StackPanel Name="stackPanel1" Margin="5">
        <Expander  Margin="0,0,0,10" DockPanel.Dock="top" Background="white" FocusVisualStyle="{x:Null}">
                <Expander.Header>
                  <TextBlock Margin="10,0,0,0"  FontFamily="Calibri" FontWeight="bold" >Approximate </TextBlock>
                </Expander.Header>
                <ListBox Name="LayoutListBox" DataContext="{Binding Source={StaticResource SamplesList}, XPath=/Samples/Category[1]/Sample}"    ItemsSource="{Binding}" SelectionChanged="HandleSelectionChanged"  Style="{DynamicResource SamplesListBox}"  IsSynchronizedWithCurrentItem="True"  />
              </Expander>
              <Expander  Margin="0,0,0,10" DockPanel.Dock="top" Background="white" FocusVisualStyle="{x:Null}">
                <Expander.Header>
                  <TextBlock Margin="10,0,0,0"  FontFamily="Calibri" FontWeight="bold"  TextTrimming="WordEllipsis">Differential Equations</TextBlock>
                </Expander.Header>
                <ListBox MaxHeight="300"  DataContext="{Binding Source={StaticResource SamplesList}, XPath=/Samples/Category[2]/Sample}" ItemsSource="{Binding}" SelectionChanged="HandleSelectionChanged" Style="{DynamicResource SamplesListBox}"  IsSynchronizedWithCurrentItem="True" SelectedValue="X" />
              </Expander>
              <Expander  Margin="0,0,0,10" DockPanel.Dock="top" Background="white" FocusVisualStyle="{x:Null}">
                <Expander.Header>
                  <TextBlock Margin="10,0,0,0"  FontFamily="Calibri" FontWeight="bold" >Integration </TextBlock>
                </Expander.Header>
                <ListBox  DataContext="{Binding Source={StaticResource SamplesList}, XPath=/Samples/Category[2]/Sample}"    ItemsSource="{Binding}" SelectionChanged="HandleSelectionChanged"  Style="{DynamicResource SamplesListBox}"  IsSynchronizedWithCurrentItem="True"  />
              </Expander>
              <Expander  Margin="0,0,0,10" DockPanel.Dock="top" Background="white" FocusVisualStyle="{x:Null}">
                <Expander.Header>
                  <TextBlock Margin="10,0,0,0"  FontFamily="Calibri" FontWeight="bold" >Interpolation </TextBlock>
                </Expander.Header>
                <ListBox  DataContext="{Binding Source={StaticResource SamplesList}, XPath=/Samples/Category[3]/Sample}"    ItemsSource="{Binding}" SelectionChanged="HandleSelectionChanged"  Style="{DynamicResource SamplesListBox}"  IsSynchronizedWithCurrentItem="True"  />
              </Expander>
              <Expander  Margin="0,0,0,10" DockPanel.Dock="top" Background="white" FocusVisualStyle="{x:Null}">
                <Expander.Header>
                  <TextBlock Margin="10,0,0,0"  FontFamily="Calibri" FontWeight="bold" >Linear Systems </TextBlock>
                </Expander.Header>
                <ListBox  DataContext="{Binding Source={StaticResource SamplesList}, XPath=/Samples/Category[4]/Sample}"    ItemsSource="{Binding}" SelectionChanged="HandleSelectionChanged"  Style="{DynamicResource SamplesListBox}"  IsSynchronizedWithCurrentItem="True"  />
              </Expander>
              <Expander  Margin="0,0,0,10" DockPanel.Dock="top" Background="white" FocusVisualStyle="{x:Null}">
                <Expander.Header>
                  <TextBlock Margin="10,0,0,0"  FontFamily="Calibri" FontWeight="bold" >Non Linear equalization</TextBlock>
                </Expander.Header>
                <ListBox  DataContext="{Binding Source={StaticResource SamplesList}, XPath=/Samples/Category[5]/Sample}"    ItemsSource="{Binding}" SelectionChanged="HandleSelectionChanged"  Style="{DynamicResource SamplesListBox}"  IsSynchronizedWithCurrentItem="True"  />
              </Expander>
              <Expander  Margin="0,0,0,10" DockPanel.Dock="top" Background="white" FocusVisualStyle="{x:Null}">
                <Expander.Header>
                  <TextBlock Margin="10,0,0,0"  FontFamily="Calibri" FontWeight="bold" >Matrix Algebra</TextBlock>
                </Expander.Header>
                <ListBox  DataContext="{Binding Source={StaticResource SamplesList}, XPath=/Samples/Category[6]/Sample}"    ItemsSource="{Binding}" SelectionChanged="HandleSelectionChanged"  Style="{DynamicResource SamplesListBox}"  IsSynchronizedWithCurrentItem="True"  />
              </Expander>
              <Expander  Margin="0,0,0,10" DockPanel.Dock="top" Background="white" FocusVisualStyle="{x:Null}">
                <Expander.Header>
                  <TextBlock Margin="10,0,0,0"  FontFamily="Calibri" FontWeight="bold" >Optimizing</TextBlock>
                </Expander.Header>
                <ListBox  DataContext="{Binding Source={StaticResource SamplesList}, XPath=/Samples/Category[7]/Sample}"    ItemsSource="{Binding}" SelectionChanged="HandleSelectionChanged"  Style="{DynamicResource SamplesListBox}"  IsSynchronizedWithCurrentItem="True"  />
              </Expander>
              <Expander  Margin="0,0,0,10" DockPanel.Dock="top" Background="white" FocusVisualStyle="{x:Null}">
                <Expander.Header>
                  <TextBlock Margin="10,0,0,0"  FontFamily="Calibri" FontWeight="bold" >Regression</TextBlock>
                </Expander.Header>
                <ListBox  DataContext="{Binding Source={StaticResource SamplesList}, XPath=/Samples/Category[8]/Sample}"    ItemsSource="{Binding}" SelectionChanged="HandleSelectionChanged"  Style="{DynamicResource SamplesListBox}"  IsSynchronizedWithCurrentItem="True"  />
              </Expander>
             <Expander  Margin="0,0,0,10" DockPanel.Dock="top" Background="white" FocusVisualStyle="{x:Null}">
                <Expander.Header>
                  <TextBlock Margin="10,0,0,0"  FontFamily="Calibri" FontWeight="bold" >Statistics</TextBlock>
                </Expander.Header>
                <ListBox  DataContext="{Binding Source={StaticResource SamplesList}, XPath=/Samples/Category[9]/Sample}"    ItemsSource="{Binding}" SelectionChanged="HandleSelectionChanged"  Style="{DynamicResource SamplesListBox}"  IsSynchronizedWithCurrentItem="True"  />
              </Expander>
               <Expander  Margin="0,0,0,10" DockPanel.Dock="top" Background="white" FocusVisualStyle="{x:Null}">
                <Expander.Header>
                  <TextBlock Margin="10,0,0,0"  FontFamily="Calibri" FontWeight="bold" >Random Generator</TextBlock>
                </Expander.Header>
                <ListBox  DataContext="{Binding Source={StaticResource SamplesList}, XPath=/Samples/Category[10]/Sample}"    ItemsSource="{Binding}" SelectionChanged="HandleSelectionChanged"  Style="{DynamicResource SamplesListBox}"  IsSynchronizedWithCurrentItem="True"  />
              </Expander>
                
    </StackPanel>
</ScrollViewer>
                
                
            
             
           
                
            </DockPanel>
                    </Grid>
                   <DockPanel Name="Details"  DockPanel.LastChildFill="True">
                        <!--   <DockPanel.DataContext>
                         
                            <Binding Source="{StaticResource SamplesList}" XPath="/Samples/Category[1]/Sample"/> 
                        </DockPanel.DataContext>
                       
                        <StackPanel Margin="20,10,0,0" DockPanel.Dock="top" Orientation="Horizontal" >
                         
                            <TextBlock   Text="{Binding XPath=@Title}" FontWeight="Bold" FontSize="16pt"    />
                           
                            
                            
            </StackPanel>
                         -->
                        <Grid Margin="20,20,20,0" Width="Auto">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="311*" />
                                <ColumnDefinition Width="389*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                <RowDefinition Height="0*"  x:Name="PreviewRow" />
                <RowDefinition Height="357.96*"  x:Name="CodeRow" />
                <RowDefinition Height="0"  x:Name="ButtonRow" />
              </Grid.RowDefinitions>
              
              
              
             <!--  <GridSplitter Grid.Row="0" Grid.RowSpan="1" Margin="10,0,10,0" Opacity="0" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Width="Auto" Height="5" Background="White" Cursor="SizeNS"/>
                <RichTextBox Name="richTextBox"  Grid.Row="1"></RichTextBox> 
             <TextBox Name="TextBox1" TextChanged="HandleTextChanged" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"  FontFamily="Consolas" FontSize="12pt" BorderBrush="transparent"   
                Grid.Row="1" AcceptsTab="True" AcceptsReturn="True" Text="{Binding XPath=Syntax}"></TextBox> -->
                            <WebBrowser Grid.Row="1" x:Name="WebText" Margin="20" Grid.ColumnSpan="2"> </WebBrowser>
                        </Grid>
          </DockPanel>
                </DockPanel>
            </Grid>
        </Grid>
    </Grid>
</Window>
